package com.tl.architecture.base.fragment

import androidx.lifecycle.ViewModelProvider
import androidx.viewbinding.ViewBinding
import com.tl.architecture.base.viewmodel.BaseViewModel
import java.lang.reflect.ParameterizedType

abstract class BaseVBVMFragment<VB: ViewBinding,VM: BaseViewModel>: BaseVBFragment<VB>() {
   protected val viewModel by lazy {
        val type =
            (javaClass.genericSuperclass as ParameterizedType).actualTypeArguments[1] as Class<VM>
        ViewModelProvider(this)[type]
    }
}